Repository navigation
Optimize daily AgentRx trace workflow with three inline small-model sub-agents - #32416
Merged
pelikhan merged 4 commits intoMay 15, 2026
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Optimize daily AgentRx trace workflow
Optimize daily AgentRx trace workflow with three inline small-model sub-agents
May 15, 2026
pelikhan
marked this pull request as ready for review
May 15, 2026 18:28
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the daily AgentRx trace optimizer prompt to delegate trajectory construction, artifact summarization, and violation classification to inline small sub-agents.
Changes:
- Replaces verbose main-model instructions with sub-agent invocations.
- Adds three inline sub-agent definitions for trajectory building, artifact summarization, and failure-pattern classification.
- Keeps final recommendation selection in the parent workflow.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/daily-agentrx-trace-optimizer.md |
Adds sub-agent-based extraction/classification/summarization flow for the AgentRx optimizer workflow. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
Comment on lines
+69
to
+72
| Invoke `trajectory-builder` by passing this exact input block: | ||
| ```text | ||
| run_data_path: /tmp/agentrx/mcp-runs.json | ||
| ``` |
Comment on lines
+98
to
+103
| First, invoke `failure-pattern-classifier` by passing this exact input block: | ||
| ```text | ||
| check_path: /tmp/agentrx/runs/gh-aw-daily/check.json | ||
| judge_path: /tmp/agentrx/runs/gh-aw-daily/judge.json | ||
| ``` | ||
| Capture its markdown table output as the labeled violations list for this section. Then read that labeled table and pick the single highest-impact fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Enhancement
The daily AgentRx optimizer is a top token consumer (~5.1M tokens/run, 56 turns) with multiple extractive/classification-heavy phases still handled by the main model. This change offloads those mechanical phases to inline
smallsub-agents while preserving final recommendation synthesis in the main workflow.What does this improve?
.github/workflows/daily-agentrx-trace-optimizer.md:trajectory-builder)<details>output (artifacts-summarizer)failure-pattern-classifier)### 1) Build AgentRx input trajectory### 3) Derive one optimization recommendationAgentRx Artifactsdetails block in## Issue Output FormatWhy is this valuable?
Implementation approach:
## agent:blocks at the end of the workflow:trajectory-builder(model: small)artifacts-summarizer(model: small)failure-pattern-classifier(model: small)run_data_path,run_dir,check_path,judge_path) and explicit output expectations (/tmp/agentrx/trajectory.json, markdown details body, labeled violations table).It must produce
/tmp/agentrx/trajectory.json.